package com.ejkj.pdf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName ExcelConfiguration
 * @Description TODO
 * @Author skies
 * @Date 2021/2/4 09:23
 * @Version 1.0
 */
@Configuration
@ConditionalOnClass(PdfService.class)
@EnableConfigurationProperties(PdfProperties.class)
public class PdfConfiguration {

	@Autowired
	PdfProperties properties;

	@Bean
	@ConditionalOnMissingBean(PdfService.class)
	public PdfService pdfService() {
		PdfService pdf = new PdfService();
		pdf.setProperties(properties);
		return pdf;
	}

}
